
package com.jf.cloud.api.distribution.feign;

import com.jf.cloud.api.distribution.vo.DistributionSpuVO;
import com.jf.cloud.common.feign.FeignInsideAuthConfig;
import com.jf.cloud.common.response.ServerResponseEntity;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * @author zz
 * @date 2021-08-05 16:07:34
 */
@FeignClient(value = "jfcloud-distribution",contextId ="distribution")
public interface DistributionFeignClient {

    /**
     * 根据主键id获取分销信息
     * @param distributionId 主键id
     * @return
     */
    @GetMapping(value = FeignInsideAuthConfig.FEIGN_URL_PREFIX + "/insider/distributionSpu/getByDistributionId")
    ServerResponseEntity<DistributionSpuVO> getByDistributionId(@RequestParam("distributionId") Long distributionId);

    /**
     * 根据商品id获取分销信息
     * @param spuId 商品id
     * @return
     */
    @GetMapping(value = FeignInsideAuthConfig.FEIGN_URL_PREFIX + "/insider/distributionSpu/getBySpuId")
    ServerResponseEntity<DistributionSpuVO> getBySpuId(@RequestParam("spuId") Long spuId);

    /**
     * 处理商品下线
     *
     * @param spuIds 商品id列表
     * @param shopIds 店铺id
     * @param state 状态
     * @return
     */
    @GetMapping(value = FeignInsideAuthConfig.FEIGN_URL_PREFIX + "/insider/distributionSpu/handleSpuState")
    ServerResponseEntity<Void> handleSpuState(@RequestParam("spuIds") List<Long> spuIds, @RequestParam("shopIds") List<Long> shopIds, @RequestParam("state") Integer state);
}
